package com.lib.common.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * @author 一叶丶枫凌
 *         Created on 2016-12-14 2:50
 */
public class NoScrollGridView extends GridView {

	public NoScrollGridView(Context context) {

		this(context, null);
	}

	public NoScrollGridView(Context context, AttributeSet attrs) {

		this(context, attrs, 0);
	}

	public NoScrollGridView(Context context, AttributeSet attrs, int defStyle) {

		super(context, attrs, defStyle);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

		heightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	}
}